package com.transaction.demo.trade.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.transaction.demo.common.util.Result;
import com.transaction.demo.common.util.ResultPage;
import com.transaction.demo.trade.vo.req.TradePaymentRecordReqVo;
import com.transaction.demo.trade.vo.req.TradePaymentRecordListReqVo;
import com.transaction.demo.trade.vo.req.TradePaymentRecordUpdateReqVo;
import com.transaction.demo.trade.vo.resp.TradePaymentRecordRespVo;
import com.transaction.demo.trade.service.TradePaymentRecordService;

/**
 * 描述：支付记录表
 * 作者：马庆智
 * 日期：2023/04/27 17:22:10
 */
@Api(tags = "支付记录表")
@RestController
@RequestMapping("/tradePaymentRecord")
public class TradePaymentRecordController {

   @Autowired
   private TradePaymentRecordService tradePaymentRecordService;

   /**
    * 查询支付记录表
    *
    * @param record 请求参数
    * @return TradePaymentRecordResp
    * @author 马庆智
    * @date: 2023/04/27 17:22:10
    */
   @ApiOperation("查询支付记录表")
   @PostMapping("/queryTradePaymentRecord")
   public TradePaymentRecordRespVo query(@RequestBody @Valid TradePaymentRecordReqVo record){
       return tradePaymentRecordService.queryTradePaymentRecord(record);
   }

   /**
    * 查询支付记录表列表
    *
    * @param record 请求参数
    * @return TradePaymentRecordResp
    * @author 马庆智
    * @date: 2023/04/27 17:22:10
    */
   @ApiOperation("查询支付记录表列表")
   @PostMapping("/queryTradePaymentRecordList")
   public Result<ResultPage<TradePaymentRecordRespVo>> queryTradePaymentRecordList(@RequestBody @Valid TradePaymentRecordListReqVo record){
        return Result.success(tradePaymentRecordService.queryTradePaymentRecordList(record));
   }



   /**
    * 删除支付记录表
    *
    * @param ids 请求参数
    * @return Result<Integer>
    * @author 马庆智
    * @date: 2023/04/27 17:22:10
    */
   @ApiOperation("删除支付记录表")
   @PostMapping("/deleteTradePaymentRecord")
   public Result<Integer> deleteTradePaymentRecord(String ids){
        return Result.success(tradePaymentRecordService.deleteTradePaymentRecord(ids));
   }

   /**
    * 更新支付记录表
    *
    * @param record 请求参数
    * @return Result<Integer>
    * @author 马庆智
    * @date: 2023/04/27 17:22:10
    */
   @ApiOperation("更新支付记录表")
   @PostMapping("/updateTradePaymentRecord")
   public Result<Integer> updateTradePaymentRecord(@RequestBody @Valid TradePaymentRecordUpdateReqVo record){
        return Result.success(tradePaymentRecordService.updateTradePaymentRecord(record));
   }

}